<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>九宫格</title>
    <style>
      html,
      body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
      /* .wrap {
        height: calc(100% / 3);
      }
      .wrap > div {
        width: calc(100% / 3);
        height: 100%;
        float: left;
      } */
      .wrap {
        display: flex;
        flex-wrap: wrap;
        height: 100%;
      }
      .wrap > div {
        width: calc(100% / 3);
        /* height: calc(100% / 3); */
      }
    </style>
  </head>
  <body>
    <div class="wrap">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <!-- </div>
    <div class="wrap"> -->
      <div>4</div>
      <div>5</div>
      <div>6</div>
      <!-- </div>
    <div class="wrap"> -->
      <div>7</div>
      <div>8</div>
      <div>9</div>
    </div>
  </body>
</html>
